# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=freecell-solver
pkgver=6.0.1
pkgrel=0
pkgdesc="A program that automatically solves layouts of Freecell and similar variants of Card Solitaire"
url="https://fc-solve.shlomifish.org"
arch="all"
license="MIT"
makedepends="
	cmake
	cmd:gperf
	cmocka-dev
	gmp-dev
	libbsd-dev
	perl
	perl-html-template
	perl-moo
	perl-path-tiny
	perl-template-toolkit
	perl-text-template
	py3-cffi
	py3-freecell-solver
	py3-pysol-cards
	py3-random2
	py3-six
	python3
	rinutils-dev
	"
subpackages="$pkgname-dev $pkgname-doc"
source="https://fc-solve.shlomifish.org/downloads/fc-solve/freecell-solver-$pkgver.tar.xz"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DFCS_WITH_TEST_SUITE=OFF \
		-DBUILD_STATIC_LIBRARY=OFF \
		-DCMAKE_SKIP_INSTALL_RPATH=TRUE
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="4e8a810a6385cb448432a54a0791ed948bacd0e4b8d02dfa1a5aed4544846384c6921ca6322496387daba825930d6f9d9fa01bdc1e3e31094fc9e6d3b0ae78e5  freecell-solver-6.0.1.tar.xz"
